//
//  AudioPlayer.h
//  test
//
//  Created by ltr on 16/4/12.
//  Copyright © 2016年 ltr. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol AudioPlayerDelegate <NSObject>

@optional
- (void)audioPlayedTimeStamp:(UInt32)timeStamp;

@end

@interface AudioPlayer : NSObject

@property (nonatomic, weak  ) id<AudioPlayerDelegate> delegate;

- (void)setSampleRate:(double)sampleRate channels:(UInt32)channels sampleBits:(UInt32)sampleBits;
- (void)addPCM:(void *)pcmBytes length:(UInt32)pcmLength timeStamp:(UInt32)timeStamp;

- (void)setVolume:(float)volume;

@end

//PCM数据
@interface PCMData : NSObject

@property (nonatomic)           char    *pcmBytes;
@property (nonatomic, assign)   UInt32  length;
@property (nonatomic, assign)   UInt32  timeStamp;

- (instancetype)initWithBytes:(void *)bytes length:(UInt32)length timeStamp:(UInt32)timeStamp;

@end



